package org.common.utils.net.netty.core;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * Netty初始化器
 * @author zhouzhibing
 * @date 2025/11/13 13:16
 */
public abstract class NettyInitializer extends ChannelInitializer<SocketChannel> {

    /**
     * 名称
     */
    protected final String name;
    /**
     * 编码器
     */
    protected final NettyEncode encode;
    /**
     * 解码器
     */
    protected final NettyDecode decode;
    /**
     * 处理器
     */
    protected final NettyHandler handler;

    public NettyInitializer(String name, NettyEncode encode, NettyDecode decode ,NettyHandler handler) {
        this.name = name;
        this.encode = encode;
        this.decode = decode;
        this.handler = handler;
    }

    public String getName() {
        return name;
    }
}
